#include <iostream>
#include <memory>

//#include "common.hpp"
//#include "lispcore.hpp"
#include "lisp.hpp"

using namespace std;



int main(int argc, char* argv[])
{
    using   lisp::nil;
    using   lisp::cons;
    using   lisp::car;
    using   lisp::cdr;
    using   lisp::var;
    using   lisp::operator<<;

    lisp::f(1, 2);
    lisp::g(1, 2);
    

    make_shared<var>(nil);
    lisp::cons(1, 1);
    var x = lisp::cons(
                    cons(
                        cons(11, 
                            "s11"), 
                        cons(12, 
                            "s12")),
                    cons(
                        cons(21, 
                            "s21"), 
                        cons(
                            cons(3.3333, 
                                nil), 
                                "s22")));
#if(1)
        cout
        <<
        car(x)
        <<endl;
        cout<<car(car(x))<<endl;
        cout<<car(car(car(x)))<<endl;
        cout<<cdr(x)<<endl;
        cout<<cdr(cdr(x))<<endl;
        cout<<cdr(cdr(cdr(x)))<<endl;

        var y = nil;
        for (int i = 0; i < atoi(argv[1]); i++)
        {
            y=cons(i,y);
        }
        cout<< y <<endl;
#endif


    cout<<endl<<"THE END"<<endl;
}


